#include<bits/stdc++.h>
using namespace std;
//int arr[10001];
int main()
{
	int N;
	cin >> N;
	vector<int> arr(N + 1);
	for (int i = 0; i < N; i++) {
		cin >> arr[i];
	}
	int maxDeep = 1;
	int maxSum = arr[0];
	int curDeep = 2;
	int tempSum = 0;
	int jud = 2;
	int powj = 2;
	for (int i = 1; i < N; i++) {
		tempSum += arr[i];
		if ( i  == jud ) {
//			cout << tempSum << endl;
			if (tempSum > maxSum) {
				maxSum = tempSum;
				tempSum = 0;
				maxDeep = curDeep;
			} else {
				tempSum = 0;
			}
			powj *= 2;
			jud += powj ;
			curDeep++;

		}
	}
	if (tempSum > maxSum) {
		maxSum = tempSum;
		tempSum = 0;
		maxDeep = curDeep;
	}

	cout << maxDeep ;
	return 0;
}

// 可以看看题解
